import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/list",
  },
  {
    path: "/about",
    name: "About",
    component: () => import("../views/About.vue"),
  },

  {
    path: "/detail",
    name: "detail",
    component: () => import("../views/detail.vue"),
  },
  {
    path: "/detail2",
    name: "detail2",
    component: () => import("../views/detail2.vue"),
  },
  {
    path: "/index",
    name: "index",
    component: () => import("../views/index.vue"),
    children: [
      {
        path: "/list",
        name: "list",
        component: () => import("../views/list.vue"),
      },
      {
        path: "/content",
        name: "content",
        component: () => import("../views/content.vue"),
      },
      {
        path: "/ping",
        name: "ping",
        component: () => import("../views/ping.vue"),
      },
      {
        path: "/my",
        name: "my",
        component: () => import("../views/my.vue"),
      },
      {
        path: "/artical",
        name: "artical",
        component: () => import("../views/artical.vue"),
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
